/*
 * @Author: yanjikun
 * @Date: 2022-06-13 14:24:12
 * @LastEditors: yanjikun
 * @LastEditTime: 2022-06-13 15:02:42
 * @Description: file content
 */
import { MockMethod } from 'vite-plugin-mock'
import menu from './menu.json'
export default [
  {
    url: '/api/v1/role/listAll',
    method: 'get',
    response: () => {
      return {
        code: 1,
        msg: '成功',
        data: [
          { id: 29, name: '平台管理员', description: null, rights: null },
          { id: 70, name: '安装人员', description: null, rights: null },
          { id: 169, name: '销售内勤', description: null, rights: null },
          { id: 170, name: '财务人员', description: null, rights: null },
          { id: 171, name: '审核人员', description: null, rights: null },
        ],
      }
    },
  },
  {
    url: '/api/v1/role/:id',
    method: 'get',
    response: () => {
      return {
        code: 1,
        msg: '成功',
        data: {
          id: 29,
          name: '平台管理员',
          description: null,
          rights: [9, 10, 27, 28],
        },
      }
    },
  },
  {
    url: '/api/v1/organizations/:id/rights',
    method: 'get',
    response: () => {
      return {
        code: 1,
        msg: '成功',
        data: menu,
      }
    },
  },
  {
    url: '/api/v1/role',
    method: 'post',
    response: () => {
      return { code: 1, msg: '成功', data: true }
    },
  },
  {
    url: '/api/v1/role/:id',
    method: 'put',
    response: () => {
      return { code: 1, msg: '成功', data: true }
    },
  },
  {
    url: '/api/v1/role/:id',
    method: 'delete',
    response: () => {
      return { code: 1, msg: '成功', data: true }
    },
  },
] as MockMethod[]
